package extend.client.httpclient;

import extend.client.base.Response;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

/**
 * 类简单描述
 *<B>说明：</B>
 *<pre>
 * 略 类详细描述
 *</pre>
 *<B>示例：</B>
 *<pre>
 *  略
 *</pre>
 *<B>日志：</B>
 *<pre>
 *  略
 *</pre>
 *<B>注意事项：</B>
 *<pre>
 *  略
 *</pre>
 */
public class HttpClientResponse extends Response
{
    /**
     * 请求对应响应
     *<B>说明：</B>
     *<pre>
     *  略
     *</pre>
     */
    protected HttpResponse httpResponse;

    public void setResponse(HttpResponse httpResponse)
    {
        this.httpResponse = httpResponse;
    }

    public String getContent()
    {
        if (this.content == null) {
            try {
                this.content = EntityUtils.toString(httpResponse.getEntity());
            } catch (Exception ex) {

            }
        }

        return this.content;
    }
}
